package com.itheima.reggie.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.sun.org.apache.bcel.internal.generic.NEW;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * mybatisplus配置类
 */
@Configuration
public class MyBatisPlusConfig {

    /**
     * mybatisplus拦截器
     * @return
     */
    @Bean
    public MybatisPlusInterceptor getMPI(){
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        //添加mybatisplus分页拦截器对象
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        return interceptor;
    }
}
